package com.fdd.service.impl;

import com.fdd.dao.BookDao;
import com.fdd.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@Component("bookService")
public class BookServiceImpl implements BookService {
    @Autowired
    @Qualifier("BookDaoImpl")
    BookDao bookDao;

    void setBookDao(BookDao bookDao) {
        this.bookDao = bookDao;
        System.out.println("BookServiceImpl::setBookDao will not used if autowire not used on setter..");
    }

    public void save() {
        System.out.println("BookServiceImpl::save ...");
        this.bookDao.save();
    }
}
